package com.picture.controller;


import com.picture.pojo.dto.PictureDto;
import com.picture.result.Result;
import com.picture.service.PictureTagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController()
@RequestMapping("/picture_tag")
@Api(tags = "图片标记相关接口")
// 允许跨域
@CrossOrigin("*")
@Slf4j
public class PictureTagController {
    // 注入PictureTagService的接口对象
    @Resource
    private PictureTagService pictureTagService;

    /**
     * 插入标记坐标和类型信息
     * @param pictureDto 图片坐标信息
     * @return 返回响应结果
     */
    @ApiOperation("插入图片标记坐标")
    @PostMapping("/insert")
    public Result<String> insert(@ApiParam("标记坐标和类型信息") @RequestBody PictureDto pictureDto) {
        return pictureTagService.insert(pictureDto);
    }

}
